

import queue
from threading import Thread
import time

q=queue.Queue()

q.put("a")
q.put("b")

for i in range(1,100):
    q.put(i)

def write_to_file(q,file):
    while q.empty() != True:
        file.write(str(q.get())+"\n")

file =open("c.txt", "a+")

t= Thread(target=write_to_file, args=(q, file))
t.start()
#
# def run():
#     q.put("b")
#     print(thread1.getName()+" is working......")
#
#     time.sleep(10)
#
# thread1 = threading.Thread(target= run)
#
#
# thread1.start()
# thread1.join()
# print(threading.current_thread().getName()+" is working....")
# time.sleep(10)

